package knowledge

import (
	"context"
	"time"
)

// Source represents a knowledge source
type Source interface {
	// ID returns the source identifier
	ID() string

	// Type returns the source type
	Type() string

	// Fetch retrieves documents from the source
	Fetch(ctx context.Context, query string) ([]*Document, error)

	// Update updates the source content
	Update(ctx context.Context) error

	// LastUpdated returns the last update time
	LastUpdated() time.Time
}

// SourceType represents different types of knowledge sources
type SourceType string

const (
	SourceTypeAPI           SourceType = "api"
	SourceTypeBlog          SourceType = "blog"
	SourceTypePaper         SourceType = "paper"
	SourceTypePractice      SourceType = "practice"
	SourceTypeGitHub        SourceType = "github"
	SourceTypeStackflow     SourceType = "stackoverflow"
	SourceTypeDocumentation SourceType = "documentation"
)

// SourceConfig contains configuration for a knowledge source
type SourceConfig struct {
	ID          string
	Type        SourceType
	URL         string
	Credentials map[string]string
	UpdateFreq  time.Duration
	Filters     []string
	MaxResults  int
}
